<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/css/backStageBase.css}">
</head>
<body class="layui-layout-body">
    <div id="backstage" class="layui-layout layui-layout-admin">
        <div class="layui-header layui-bg-blue" >
            <div class="layui-logo">青木良品</div>
            <ul class="layui-nav  layui-layout-left" lay-filter="">
                <li class="layui-nav-item">活动管理</li>
            </ul>
            <ul class="layui-nav layui-layout-right layui-bg-blue">
                <li class="layui-nav-item" th:text="'欢迎你，'+${session.user.name}">
                </li>
                <li class="layui-nav-item"><a href="/mall/user/logout.do">退出</a></li>
            </ul>
        </div>

        <div class="layui-side layui-bg-gray">
            <ul class="layui-nav layui-nav-tree layui-bg-blue" lay-filter="test">
                <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
                <li class="layui-nav-item"><a th:href="@{/admin/product/toList.html}">商品管理</a></li>
                <li class="layui-nav-item layui-nav-itemed"><a th:href="@{/admin/activity/toList.html}">活动管理</a></li>
                <li class="layui-nav-item"><a th:href="@{/admin/order/toList.html}">订单管理</a></li>
                <li class="layui-nav-item"><a th:href="@{/admin/user/toList.html}">用户管理</a></li>
            </ul>
        </div>
        <div class="layui-body" style="overflow: hidden;height: 650px;padding-top: 25px">
            <form id="updatainfo" class="layui-form" method="post" action="update.do">
                <div class="layui-form-item" style="display: none">
                    <label class="layui-form-label">活动名称</label>
                    <div class="layui-input-block" style="width: 300px;">
                        <input type="text" name="id" lay-verify="required" autocomplete="off" class="layui-input" th:value="${activity.id}">
                    </div>
                </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">活动名称</label>
                        <div class="layui-input-block" style="width: 300px;">
                            <input type="text" name="activity" lay-verify="required" placeholder="请输入活动名称" autocomplete="off" class="layui-input" th:value="${activity.activity}">
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">活动信息</label>
                        <div class="layui-input-block" style="width: 400px;">
                            <input name="remark" placeholder="请输入内容" class="layui-input" th:value="${activity.remark}">
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">活动折扣</label>
                        <div class="layui-input-block" style="width: 400px;">
                            <input name="discount" lay-verify="required|number|discount" placeholder="请输入内容" class="layui-input" th:value="${activity.discount}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button type="submit" class="layui-btn" lay-submit="" lay-filter="formDemo">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
            </form>
        </div>
    </div>
</body>
<script th:src="@{/js/jqurey.js}"></script>
<script th:src="@{/layui/layui.js}"></script>
<script type="text/javascript">
    layui.use(['element','form','table'], function(){
        var element = layui.element;
        var form = layui.form;
    });
    function delacitivity(id) {
        $.ajax({
            //请求方式
            type : "GET",
            //请求的媒体类型
            contentType: "application/json;charset=UTF-8",
            //请求地址
            url : "del.do?id="+id,
            //请求成功
            success : function(data) {
                location.reload()
            },
            error : function (e) {

            }
        });
    }
</script>
</html>